<!doctype html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>ImageDialog Examples</title>
    <link href="../themes/default/default.css" rel="stylesheet"/>
    <script src="../kindeditor.js"></script>
    <script src="../lang/zh_CN.js"></script>
    <script>
        KindEditor.ready(function (K) {
            var editor = K.editor({
                allowFileManager: true
            });
            K('#image1').click(function () {
                editor.loadPlugin('image', function () {
                    editor.plugin.imageDialog({
                        imageUrl: K('#url1').val(),
                        clickFn: function (url, title, width, height, border, align) {
                            K('#url1').val(url);
                            editor.hideDialog();
                        }
                    });
                });
            });
            K('#image2').click(function () {
                editor.loadPlugin('image', function () {
                    editor.plugin.imageDialog({
                        showLocal: false,
                        imageUrl: K('#url2').val(),
                        clickFn: function (url, title, width, height, border, align) {
                            K('#url2').val(url);
                            editor.hideDialog();
                        }
                    });
                });
            });
            K('#image3').click(function () {
                editor.loadPlugin('image', function () {
                    editor.plugin.imageDialog({
                        showRemote: false,
                        imageUrl: K('#url3').val(),
                        clickFn: function (url, title, width, height, border, align) {
                            K('#url3').val(url);
                            editor.hideDialog();
                        }
                    });
                });
            });
        });
    </script>
</head>
<body>
<p><input id="url1" type="text" value=""/> <input id="image1" type="button" value="选择图片"/>（网络图片 + 本地上传）</p>
<p><input id="url2" type="text" value=""/> <input id="image2" type="button" value="选择图片"/>（网络图片）</p>
<p><input id="url3" type="text" value=""/> <input id="image3" type="button" value="选择图片"/>（本地上传）</p>
</body>
</html>
